﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Server.Resource
{
    public static class Utility
    {
        public static long DateTimeToLong(DateTime d)
        {
            return (long)(d.AddHours(-8) - new DateTime(1970, 1, 1)).TotalSeconds;

        }
        public static DateTime DateTimeFromLong(long d)
        {
            return new DateTime(1970, 1, 1).AddHours(8).AddSeconds(d);
        }
    }
}
